package cn.itcast.nems.order.dao.mapper;

import cn.itcast.nems.order.dao.entity.OrderDiscount;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 销售订单-优惠 Mapper 接口
 * </p>
 *
 * @author liyong
 * @since 2023-08-31
 */
@Mapper
public interface OrderDiscountMapper extends BaseMapper<OrderDiscount> {

    /**
     * 查看优惠
     * @param orderLineId
     * @return
     */
    List<Map<String, Object>> listOrderDiscount(String orderLineId);

    /**
     * 查看优惠优惠合计
     * @param orderLineId
     * @return
     */
    Integer getTotalAmount(String orderLineId);

    /**
     * 查询订单关联的优惠
     * @param orderId 订单ID
     * @return 优惠信息
     */
    List<OrderDiscount> selectOrderDiscounts(@Param("orderId") String orderId);
}
